import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    // 令牌 token
    tokenInfo: JSON.parse(localStorage.getItem('tokenInfo')) || null
  },
  getters: {
  },
  mutations: {
    changeToken(state, value) {
      state.tokenInfo = JSON.parse(value)
      localStorage.setItem("tokenInfo", value)
    }
  },
  actions: {
  },
  modules: {
  }
})
